clear all;

%% plot 
fig=figure('color', [1 1 1 ], 'Position',[200 20 800 400]);

ah1 = axes('Parent',fig,'Units','normalized','Position',[0.1300 0.3200 0.3347 0.624]);
load('wealth_prod.mat')

plot(x1, y1, '-b' , 'LineWidth', 2 );
hold on
plot(x3, y3, '-.r' , 'LineWidth', 2 );
hold on
plot(x2, y2, '--b' , 'LineWidth', 2 );
hold on
plot(x4, y4, ':r' , 'LineWidth', 2 );

title( 'A. Given $a_t/(m_t+a_t)$', 'FontSize',15,'Interpreter','Latex');
% title( 'A. Occupation choice (given $\frac{a_t}{m_t+a_t}$)', 'FontSize',15,'Interpreter','Latex');
xlabel('total wealth $m_t+a_t$', 'FontSize',12,'Interpreter','Latex');
ylabel('talent $z_t$', 'FontSize',12,'Interpreter','Latex');
text(10, 2.35, 'entrepreneur (borrow)', 'FontSize',10,'Interpreter','Latex');
text(5, 1.5, 'entrepreneur (not borrow)', 'FontSize',10,'Interpreter','Latex');
text(0.4, 1.08, 'worker/farmer', 'FontSize',10,'Interpreter','Latex');
xlim([0,20]);
xticks(0:5:20);
ylim([1.0,2.5]);
% yticks(1.0:0.3:2.5);
legend('occupation boundary ($d_{i,t}=2$ min)','occupation boundary ($d_{i,t}=0$ min)',...
    'borrowing boundary ($d_{i,t}=2$ min)','borrowing boundary ($d_{i,t}=0$ min)',...
    'interpreter','latex','location',[0.5175 0.12 0 0],'Numcolumns',2) %[0.5175 0.12 0 0] [0.509 0.12 0 0]
set(gca,'FontSize',12);


ah2 = axes('Parent',fig,'Units','normalized','Position',[0.5703 0.3200 0.3347 0.624]);

load('wealth_deposit_ratio.mat')
plot(x1, y1, '-b' , 'LineWidth', 2 );
hold on
plot(x2, y2, '--b' , 'LineWidth', 2 );
hold on
plot(x3, y3, '--b' , 'LineWidth', 2 );
hold on
plot(x4, y4, '-.r' , 'LineWidth', 2 );
hold on
plot(x5, y5, ':r' , 'LineWidth', 2 );
hold on
plot(x6, y6, ':r' , 'LineWidth', 2 );

h=text(4, 0.4, 'entrepreneur (not borrow)', 'FontSize',10,'Interpreter','Latex');
set(h,'Rotation',45);
h=text(13, 0.02, 'entrepreneur (borrow)', 'FontSize',10,'Interpreter','Latex');
set(h,'Rotation',45);
h=text(0.2, 0.965, 'worker/farmer', 'FontSize',10,'Interpreter','Latex');
title( 'B. Given $z_t$', 'FontSize',15,'Interpreter','Latex');
xlabel('total wealth $m_t+a_t$', 'FontSize',12,'Interpreter','Latex');
ylabel('deposit-wealth ratio $a_t/(m_t+a_t)$', 'FontSize',12,'Interpreter','Latex');
xlim([0,20]);
xticks(0:5:20);
ylim([0,1]);
set(gca,'FontSize',12);
 

